import {createRouter,createWebHistory} from 'vue-router'
import LoginVue from "@/views/login/Login.vue";
import Layout from "@/views/common/Layout.vue";
import Book1 from "@/views/book/Book1.vue";
import Book2 from "@/views/book/Book2.vue";
import UserInfo from "@/views/user/UserInfo.vue";
import UserResetPassword from "@/views/user/UserResetPassword.vue";
import UserAvatar from "@/views/user/UserAvatar.vue";
import Chat from "@/views/chat/chat.vue";


const routes = [
    {path:'/login', component:LoginVue},
    {path:'/chat',component:Chat},
    {path:'/', component:Layout, redirect:'book',children:[
            {path:'/book',component:Book1},
            {path:'/book2',component:Book2},
            {path:'/user/info',component:UserInfo},
            {path:'/user/resetPassword',component:UserResetPassword},
            {path:'/user/avatar',component:UserAvatar},
        ]}
]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
})
//导出路由
export default router

